/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.amu.wmi.kino.visualjavafx.model.generators.modelproviders;

import java.awt.Color;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.animationTime.Timeline;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.interpolators.Linear;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.transformations.ChangeVisibility;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.transformations.Translation;
import pl.edu.amu.wmi.kino.visualjavafx.model.api.ModelChangeEvent;
import pl.edu.amu.wmi.kino.visualjavafx.model.api.ModelChangeListener;
import pl.edu.amu.wmi.kino.visualjavafx.model.api.VisualJavaFxModelProvider;
import pl.edu.amu.wmi.kino.visualjavafx.model.generators.ModelCanvasGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.model.generators.ModelCircleGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.model.generators.ModelFrameGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.model.generators.ModelTranslationGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.Application;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.Canvas;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.Frame;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.shapes.Circle;
/**
 *Model with one circle and two translations and visibility change
 * @author Admin
 */


public class CircleTest2Provider implements VisualJavaFxModelProvider{

    @Override
    public Application getModel() {
        Application app = new Application();
        ArrayList<Frame> frames = app.getFrames();
        Canvas can = ModelCanvasGenerator.generateCanvas(Color.PINK);

        Circle c = ModelCircleGenerator.generateCircle(500, 300, 100, Color.RED, Color.GREEN,
                5);

        Translation t1 = ModelTranslationGenerator.generateTranslation(800, 600, new Linear(),
                new Linear());
        Translation t2 = ModelTranslationGenerator.generateTranslation(0, 0,
                new Linear(), new Linear());
        ChangeVisibility v1 = new ChangeVisibility();
        v1.setDestinedVisibility(false);
        ChangeVisibility v2 = new ChangeVisibility();
        v2.setDestinedVisibility(true);

        Timeline timeline = c.getTimeline();
        timeline.getKeyFrameAt(3).getTransformations().add(t1);
        timeline.getKeyFrameAt(5).getTransformations().add(t2);
        timeline.getKeyFrameAt(2).getTransformations().add(v1);
        timeline.getKeyFrameAt(4).getTransformations().add(v2);

        can.getContent().add(c);
        
        Frame f = ModelFrameGenerator.generateFrame(1000, 800, 50, 50, "test", can);
        frames.add(f);

        return app;
    }



    @Override
    public void addModelChangeListener(ModelChangeListener listener) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void notifyModelChange(ModelChangeEvent evt) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void removeModelChangeListener(ModelChangeListener listener) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
